package dexter.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesReader {
	
	public static Properties getProperties(String key){
		
		Properties p=new Properties();
		File f = (new File(key));
		try {
			
			InputStream in=new FileInputStream(f);
			p.load(in);
			in.close();
		} catch (Exception e) {
			//e.printStackTrace();
			System.out.println("Properties file not found : "+f.getAbsolutePath());		
			return null;
		}
		return p;
		
	}

	public static Properties getDefaultProperties() {
			
			 Properties p = new Properties();
			 p.setProperty("group", "101010101");
			 p.setProperty("session_id", "44444444");
			 
			 p.setProperty("coord_host", "localhost");
			 p.setProperty("coord_port", "54323");
			 
			 p.setProperty("port", "5555");
			 p.setProperty("host", "localhost");	 
			 
			 p.setProperty("num_nodes","10");		
			 
			 p.setProperty("test_path", ".."+File.separator+"classes"+File.separator);
		     p.setProperty("testclass", "asd.test.DHTAllTests");
			 
			 return p;
		}
}
